package br.edu.ufcg.ga.stopcondition;

public class MaxBestFitnessRepetitionStopCondition extends StopCondition {

	private int maxRepetitionOfBestFitness;

	public MaxBestFitnessRepetitionStopCondition(int maxRepetitionOfBestFitness) {
		this.maxRepetitionOfBestFitness = maxRepetitionOfBestFitness;
	}

	@Override
	protected boolean workIsDone(int cGeneration, double cBestFitness) {
		return this.maxRepetitionOfBestFitness == getCMaxRepetitionOfBestFitness();
	}

}